<template>
  <ele-card>
    <div class="top-search">
      <el-input v-model="activityTitle" placeholder="请输入活动名称" />
      <el-button type="primary" @click="onSearch">搜索</el-button>
    </div>
  </ele-card>
</template>

<script setup>
  import { ref } from 'vue';

  const emit = defineEmits(['search']);

  const activityTitle = ref('');

  const onSearch = () => {
    emit('search', activityTitle.value);
  };
</script>

<style lang="scss" scoped>
  .top-search {
    max-width: 480px;
    margin: 24px auto;
    display: flex;

    :deep(.el-input__wrapper) {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }

    .el-button {
      margin-left: -1px;
      position: relative;
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
</style>
